import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:"/",
    redirect: '/All/Index',  // 重定向:重新指向其它path,会改变网址

  
  },
  {
    path: '/All',
    name: 'All',
    component: () => import('../page/All.vue'),
    children:[
      {
        path: '/All/Index',
        name: 'Index',
        component: () => import('../page/Index.vue'),
      },
      {
        path: '/All/Classify',
        name: 'Classify',
        component: () => import('../page/Classify.vue'),
      },
      {
        path: '/All/Shop',
        name: 'Shop',
        component: () => import('../page/Shop.vue'),
      },
      {
        path: '/All/My',
        name: 'My',
        component: () => import('../page/My.vue'),
      }
    ]
  },
  // {
  //   path: '/about',
  //   name: 'about',
  //   component: () => import('../views/AboutView.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
